<template>
	<view>
		<view class="hot-card" v-for="(item,index) in localhotProducts" :key="index">
			<image :src="item.image" class="hot-img" mode="aspectFill"></image>
			<view class="hot-text-area">
				<view class="desc-style">{{item.desc}}</view>
				<view class="name-style">{{item.storeName}}</view>
				<view class="time-style">今天17:19</view>
				<view class="row-icon">
					<iconRowVue :currentProduct="item" style="width:100%;"></iconRowVue>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref,defineEmits,defineProps } from 'vue'
	import iconRowVue from '../../../components/iconRow.vue'
	import{Product} from '../../../types/types'
	const props = defineProps<{
		hotProducts:Product[],
	}>()
	
	// 定义一个本地变量用于双向绑定
	const localhotProducts = ref(props.hotProducts);
</script>

<style lang="scss" scoped>
.hot-card{
	width: 95%;
	margin: 0 0.5rem;
	background-color: #fff;
	height: 7.13rem;
	border-radius: 0.63rem;
	color: rgba(16,16,16,1);
	font-size: 0.88rem;
	display: flex;
	align-items: center;
	padding: 0 0.5rem;
	box-sizing: border-box;
}
.hot-img{
	width: 9.06rem;
	height: 6.13rem;
	border-radius: 0.63rem;
}
.hot-text-area{
	margin-left: 0.69rem;
	flex: 1;
	width: 13rem;
	color: rgba(16,16,16,1);
}
.desc-style{
	width: 100%;
	height: 2.1rem;
	font-size: 0.75rem;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.name-style{
	width: 5rem;
	height: 1rem;
	margin-top: 0.2rem;
	font-size: 0.75rem;
	text-align: center;
	font-weight: 600;
}
.time-style{
	width: 4.5rem;
	height: 1.06rem;
	font-size: 0.75rem;
	text-align: center;
	margin-top: 0.2rem;
}
.row-icon{
	display: flex;
	margin: 0.2rem ;
	width:12rem;
	font-size: 0.5rem;
	color: #101010 80%;
}
</style>
